#include <iostream>
#include <cmath>
using namespace std;
int main()
{
	int L;
	int l[10000];
	int i,t,g,r=0,sign=0,p=0;
	bool sign2=false,sign3=false;
	cin>>L;
	for (i=2;;i++)
	{
		for (g=2;g<=(i+1);g++)
		{
			if (g==1 || g==i) continue;
			else if (i%g==0) 
			{
				sign3 = false;
				break;
			}
			else 
			{
				sign3 = true;
				continue;
			}
		}
		if (sign3==true) 
		{
			l[r] = i;
			sign = sign + l[r];
			r++;
			sign2 = true;
		}
		if (sign>L) break;
		else if (sign2==true) 
		{
			cout<<l[r-1]<<'\n';
			p++;
		}
		sign2 = false;
	}
	cout<<p<<endl;
	return 0;
}
